package sj.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import sj.service.WalletService;
import sj.util.Result;


import java.math.BigDecimal;

@RestController
public class WalletController {

    @Autowired
    private WalletService walletService;


    @PostMapping("/getMoneyByWallet")
    public Result getMoneyByWallet(@RequestParam("userId") Integer userId){
        BigDecimal money = walletService.getMoneyInWallet(userId);
        return new Result(200, "查询成功", money);
    }





}
